﻿<!DOCTYPE html>
<html lang="zh-cn" data-qqkey="" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>用户注册</title>
    <meta name="format-detection" content="telephone=no, address=no">
    <meta name="apple-mobile-web-app-capable" content="yes"/> <!-- apple devices fullscreen -->
    <meta name="apple-touch-fullscreen" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <link rel="shortcut icon" href="/static/copy/picture/atxx1bundbvtx1vbdvtbbtb2zvcbbb.jpg"/>
    <script src="/static/copy/js/jweixin-1.4.0.js"></script>
    <script type="text/javascript" src="/static/copy/js/util.js"></script>
    <script src="/static/copy/js/require.js"></script>
    <script type="text/javascript" src="/static/copy/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="/static/copy/js/mui.min.js"></script>
    <script type="text/javascript" src="/static/copy/js/common.js"></script>
    <link href="/static/copy/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/copy/css/common.min.css" rel="stylesheet">
    <script type="text/javascript">
        if (navigator.appName == 'Microsoft Internet Explorer') {
            if (navigator.userAgent.indexOf("MSIE 5.0") > 0 || navigator.userAgent.indexOf("MSIE 6.0") > 0 || navigator.userAgent.indexOf("MSIE 7.0") > 0) {
                alert('您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.');
            }
        }
        window.sysinfo = {
            'uniacid': '17', 'acid': '17', 'siteroot': 'http://888.huipin.co/',
            'siteurl': 'http://888.huipin.co/app/index.php?i=17&c=auth&a=register&forward=aT0xNyZjPWVudHJ5Jm09cmVjaGFyZ2UmZG89cGF5Jnd4cmVmPW1wLndlaXhpbi5xcS5jb20%3D&wxref=mp.weixin.qq.com',
            'attachurl': 'http://888.huipin.co/attachment/',
            'attachurl_local': 'http://888.huipin.co/attachment/',
            'attachurl_remote': '',
            'cookie': {'pre': '03ad_'}
        };
        // jssdk config 对象
        jssdkconfig = null || {};
        // 是否启用调试
        jssdkconfig.debug = false;
        jssdkconfig.jsApiList = [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'hideMenuItems',
            'showMenuItems',
            'hideAllNonBaseMenuItem',
            'showAllNonBaseMenuItem',
            'translateVoice',
            'startRecord',
            'stopRecord',
            'onRecordEnd',
            'playVoice',
            'pauseVoice',
            'stopVoice',
            'uploadVoice',
            'downloadVoice',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'getNetworkType',
            'openLocation',
            'getLocation',
            'hideOptionMenu',
            'showOptionMenu',
            'closeWindow',
            'scanQRCode',
            'chooseWXPay',
            'openProductSpecificView',
            'addCard',
            'chooseCard',
            'openCard',
            'openAddress'
        ];
    </script>
</head>
<body>
<div class="container container-fill">
    <script>
        $(function () {
            $(document).on('input propertychange', '.js-mobile-val', function () {
                var mobile_value = $(this).val();
                if (mobile_value.length == '11') {
                    $('.js-check-mobile').addClass('send-code');
                } else {
                    $('.js-check-mobile').removeClass('send-code');
                }
            });
            $(document).on('click', '.send-code', function () {
                var username = $('#register-code input[name="username"]').val();
                var uniacid = $(this).attr('uniacid');
                if (!username) {
                    util.toast('请输入手机号', '', 'error');
                    return;
                }
                if (!/^1[3|4|5|7|8][0-9]{9}$/.test(username)) {
                    util.toast('手机号格式错误', '', 'error');
                    return;
                }
                if (!uniacid) {
                    util.toast('给定的参数有错误', '', 'error');
                    return;
                }
                ;
                var downcount = 60;
                $('.js-timer').html(downcount + '秒后重新获取');
                var timer = setInterval(function () {
                    downcount--;
                    if (downcount <= 0) {
                        clearInterval(timer);
                        downcount = 60;
                        $('.js-timer').html('<a class="send-code" uniacid="17">重新获取验证码</a>');
                    } else {
                        $('.js-timer').html(downcount + "秒后重新获取");
                    }
                }, 1000);
                var params = {};
                params.receiver = username;
                params.uniacid = uniacid;
                $.post('../web/index.php?c=utility&a=verifycode', params, function (dat) {
                    if (dat.message.errno == 0) {
                        util.toast('发送验证码成功');
                        $('.codeverify .mui-text-success').text(username);
                        $('.sendcode').hide();
                        $('.codeverify').show();
                    } else {
                        util.toast('发送验证码失败', '', 'error');
                        $('.sendcode').show();
                        $('.codeverify').hide();
                    }
                }, "json");
            });
            $(document).on('click', '.js-code', function () {
                var username = $('#register-code input[name="username"]').val();
                var password = $('#register-code input[name="password"]').val();
                audit_password = '';
                audit_repassword = '';
                if (!username) {
                    util.toast('请输入手机号', '', 'error');
                    return;
                }
                if (!password) {
                    util.toast('请输入验证码', '', 'error');
                    return;
                }
                var href = "./index.php?i=17&c=auth&a=register&code=1&wxref=mp.weixin.qq.com#wechat_redirect";
                $.post(href, {
                    'username': username,
                    'password': password,
                    'audit_password': audit_password,
                    'audit_repassword': audit_repassword
                }, function (data) {
                    data = $.parseJSON(data);
                    if (data.type == 'success') {
                        location.reload();
                    } else {
                        util.toast(data.message);
                    }
                })
            });
            $(document).on('click', '.register-basic', function () {
                var username = $('#register-basic input[name="username"]').val();
                var password = $('#register-basic input[name="password"]').val();
                var repassword = $('#register-basic input[name="repassword"]').val();
                if (!username || !password || !repassword) {
                    util.toast('手机号或密码为空', '', 'error');
                    return;
                }
                if (password.length < 6) {
                    util.toast('密码不能小于六位数', '', 'error');
                    return;
                }
                if (password !== repassword) {
                    util.toast('两次密码输入不一致', '', 'error');
                    return;
                }
                var params = {};
                params.username = username;
                params.password = password;
                params.repassword = repassword;
                params["action"] = "regist";
                var href = "/user/regist";
                $.post(href, params, function (data) {
                    if (data.status == 200) {
                        util.toast(data.msg,data.data); //跳转
//                        location.reload();
                    } else {
                        util.toast(data.msg, '', 'error');
                    }
                })
            })
        });
    </script>
    <div class="mui-content mc-login">
        <div class="avatar mui-text-center">
            <img src="/static/copy/picture/headimg_17.jpg" class="mui-img-circle"/>
        </div>
            <div class="mui-input-group" id="register-basic">
                <div class="mui-input-row">
                    <label class="mui-label-icon"><i class="fa fa-user"></i></label>
                    <input name="username" type="text" placeholder="请填写手机号/邮箱"/>
                </div>
                <div class="mui-input-row">
                    <label class="mui-label-icon"><i class="fa fa-lock"></i></label>
                    <input name="password" type="password" placeholder="密码" class="mui-input-password"/>
                </div>
                <div class="mui-input-row">
                    <label class="mui-label-icon"><i class="fa fa-lock"></i></label>
                    <input name="repassword" type="password" placeholder="确认密码" class="mui-input-password"/>
                </div>
            </div>
            <div class="mui-content-padded">
                <button class="mui-btn mui-btn-success mui-btn-block register-basic" type="submit">注册</button>
            </div>

        <div class="mui-content-padded">
            <div class="mui-text-center mui-mt15">
                <a href="/user/login">立即登录</a>
                <span class="mui-ml5 mui-mr5 mui-text-muted">|</span>
                <a href="javascript:inform()">无密码注册
                </a>

                <span class="mui-ml5 mui-mr5 mui-text-muted">|</span>
                <a href="javascript:inform()">找回密码</a>
            </div>
        </div>
    </div>
</div>
<script>
    function inform() {
        util.toast("维护中..");
        return false;
    }

</script>
</body>
</html>

